<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">

<h:body>
<h1>JSF 2 valueChangeListener example</h1>
<h:form>

<h:outputText id="echo" value="#{country.name}" />
<h:outputText id="count" value="#{country.count}" />
<h:panelGrid columns="2">
	Enter Name:
	<h:inputText value="#{country.name}" >
		<f:ajax event="keyup" render="echo count" listener="#{country.countListener}" />
	</h:inputText>	
	
	Selected Country:
	<h:inputText id="country" value="#{country.localeCode}" size="20" />
	
	Select a country {method binding}:
	<h:selectOneMenu value="#{country.localeCode}" onchange="submit()"
		valueChangeListener="#{country.countryLocaleCodeChanged}">
		<f:selectItems value="#{country.countriesInMap}"/>
	</h:selectOneMenu>
	<!-- 
	Select a country {Ajax call}:
	<h:selectOneMenu id="selectCountry" value="#{country.localeCode}">
		<f:selectItems value="#{country.countriesInMap}"/>
		<f:ajax event="change" render="country" listener="country.ajaxCountryLocaleCodeChanged" />
	</h:selectOneMenu>
	-->	
</h:panelGrid>
</h:form>

<hr/>

<h:form id="form">
	<h:outputText value="#{normal.buttonId}" /><br />
	<h:commandButton value="Submit" id="submitButton" action="#{normal.outcome}" actionListener="#{normal.printIt}" />
</h:form>
</h:body>
</html>